package cloud.maque.common.core.enums;

import org.springframework.core.convert.converter.Converter;

public class LoginTypeConverter implements Converter<String, LoginType> {
    @Override
    public LoginType convert(String source) {
        if (source == null || source.isEmpty()) {
            return null;
        }
        try {
            return LoginType.valueOf(source.toUpperCase());
        } catch (IllegalArgumentException e) {
            return null;
        }
    }
}